<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="moil">
<head>
    <%@include file="/WEB-INF/jsp/commons/meta.jsp" %>
    <title>${title}</title>
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <!-- 响应式设计 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javascript">
        (function () {
            angular.module("moil", []);
            window.AllDocCtrl = function ($scope, $rootScope) {
            }
        })();
    </script>
</head>
<body ng-controller="AllDocCtrl">
<!-- content -->
<!-- 分页显示演示开始 -->
<div class="u_child_box">
    <div class="u_title_bar">
        <span id="device_info" class="u_title">设备管理</span>
    </div>

    <div class="u_c_header ">
        <div class="u_c_m_h">
            <form id="listForm" class="form-inline" action="${ctx}/moil/device/list" method="get">
                <input type="hidden" name="pageNo" id="pageNo" value="${pageData.pagination.pageNo}"/>
                <input type="hidden" name="fieldName" id="fieldName" value="${pageData.compositor.fieldName}"/>
                <input type="hidden" name="compositorType" id="compositorType"
                       value="${pageData.compositor.compositorType}"/>

                <div class="pull-left">
                    <label>设备品牌:</label>
                    <y:search fieldType="S" fieldList="brand" matchType="LIKE" className="input-medium search-query"/>
                    <button class="btn u_c_btn" onclick="search()" type="button">
                        <i class="icon-search"></i>
                        搜索
                    </button>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
        <tr>
            <th><label class="checkbox"><input type="checkbox"/></label></th>
            <th>#</th>
            <th>
                <a href="javascript:sort('imei')">IMEI</a>
            </th>
            <th>
                <a href="javascript:sort('deviceType')">设备类型</a>
            </th>
            <th>
                <a href="javascript:sort('osVersion')">系统版本</a>
            </th>
            <th>
                <a href="javascript:sort('brand')">品牌</a>
            </th>
            <th>
                <a href="javascript:sort('model')">型号</a>
            </th>
            <th><a href="javascript:sort('insertTime')">注册时间</a></th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="entity" items="${pageData.result}" varStatus="index">
            <tr  <c:if test="${!entity.visible}"></c:if>>
                <td><label class="checkbox"><input type="checkbox"/></label></td>
                <td>${index.index + 1}</td>
                <td>${entity.imei}</td>
                <td>${entity.deviceType}</td>
                <td>${entity.osVersion}</td>
                <td>${entity.brand}</td>
                <td>${entity.model}</td>
                <td>${entity.insertTime}</td>
                <td>
                    <a href="${ctx}/moil/device/delete/${entity.id}" confirm="删除后无法恢复,确定要删除吗?">刪除</a>
                </td>
            </tr>
        </c:forEach>
        <c:if test="${fn:length(pageData.result) < 1}">
            <tr>
                <td colspan="9">暂无数据...</td>
            </tr>
        </c:if>
        </tbody>
    </table>
    <%@ include file="/WEB-INF/jsp/commons/pager.jsp" %>
</div>
<div class="u_c_header ">
    <div class="u_c_m_h">
        <form class="form-inline">
            <div class="pull-left" style="padding: 8px;">
                <div class="btn-group">
                    <button class="btn  btn-info" ng-click="AndroidCtroller.lockScreen()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-lock"></i>
                        锁屏
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.unlock()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-trash"></i>
                        解锁
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.warnBell()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-bell"></i>
                        报警
                    </button>
                    <button class="btn btn-info" ng-click="AndroidCtroller.clearSDData()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-remove-sign"></i>
                        擦除SD卡数据
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.restore()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-share"></i>
                        恢复出厂设置
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.location()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-map-marker"></i>
                        远程定位
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.network()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-cog"></i>
                        网络控制
                    </button>
                </div>
            </div>
            <div class="pull-right" style="padding: 8px;">
                <button class="btn btn-info" type="button" ng-click="sendMsg()" ng-disabled="AndroidCtroller.disabled">
                    <i class="icon-envelope"></i>
                    发送消息
                </button>
            </div>

        </form>

    </div>
</div>
<div id="msgModal" data-backdrop="false"
     style="border: none; width: 60%; margin-left: -30%;top:50%;margin-top: -20%;"
     class="modal hide fade"
     role="dialog"
     aria-labelledby="commonModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h5 title>推送文本消息</h5>
    </div>
    <div class="modal-body" style="max-height: 100%; ">

        <div style="margin-bottom: 15px;">
            <input type="text" ng-model="msg.title" maxlength="30" style="width: 95%;" placeholder="请输入30字之内的标题"/>
        </div>

        <textarea maxlength="250" ng-model="msg.content" style="width: 95%;height:150px;"
                  placeholder="请输入250字之内的内容"></textarea>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn btn-info" ng-click="AndroidCtroller.sendMsg(msg)">发 送</a>
        <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">关 闭</a>
    </div>
</div>
</body>
</html>